package phapp.model.system;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import javacommon.base.BaseEntity;

/**
 * Title: ts_sys_user 数据类 POJO Description: DAO层映射到数据类,页面封装数据映射到数据类 Copyright:
 * Copyright (c) 2012-10 Company:
 * 
 * @author you name
 * @version 1.0
 */

public class SysUser extends BaseEntity
{

   // date formats
   public static final String FORMAT_REGIST_DATE = DATE_TIME_FORMAT;
   public static final String FORMAT_UPDATE_DATE = DATE_TIME_FORMAT;

   // columns START
   /** userId */
   private java.lang.Integer userId;
   /** userAccount */
   private java.lang.String userAccount;
   /** userName */
   private java.lang.String userName;
   /** userPasswd */
   private java.lang.String userPasswd;
   /** registDate */
   private java.sql.Timestamp registDate;
   /** updateDate */
   private java.sql.Timestamp updateDate;
   /** userStatus */
   private java.lang.Integer userStatus;
   /** userNote */
   private java.lang.String userNote;

   private java.util.ArrayList idList;

   // columns END

   public SysUser()
   {
   }

   public SysUser(java.lang.Integer userId)
   {
      this.userId = userId;
   }

   public void setId(java.lang.Integer value)
   {
      this.userId = value;
   }

   public java.lang.Integer getId()
   {
      return this.userId;
   }
   
   public void setUserId(java.lang.Integer value)
   {
      this.userId = value;
   }

   public java.lang.Integer getUserId()
   {
      return this.userId;
   }

   public void setUserAccount(java.lang.String value)
   {
      this.userAccount = value;
   }

   public java.lang.String getUserAccount()
   {
      return this.userAccount;
   }

   public void setUserName(java.lang.String value)
   {
      this.userName = value;
   }

   public java.lang.String getUserName()
   {
      return this.userName;
   }

   public void setUserPasswd(java.lang.String value)
   {
      this.userPasswd = value;
   }

   public java.lang.String getUserPasswd()
   {
      return this.userPasswd;
   }

   public String getRegistDateString()
   {
      return date2String(getRegistDate(), FORMAT_REGIST_DATE);
   }

   public void setRegistDateString(String value)
   {
      setRegistDate(string2Date(value, FORMAT_REGIST_DATE, java.sql.Timestamp.class));
   }

   public void setRegistDate(java.sql.Timestamp value)
   {
      this.registDate = value;
   }

   public java.sql.Timestamp getRegistDate()
   {
      return this.registDate;
   }

   public String getUpdateDateString()
   {
      return date2String(getUpdateDate(), FORMAT_UPDATE_DATE);
   }

   public void setUpdateDateString(String value)
   {
      setUpdateDate(string2Date(value, FORMAT_UPDATE_DATE, java.sql.Timestamp.class));
   }

   public void setUpdateDate(java.sql.Timestamp value)
   {
      this.updateDate = value;
   }

   public java.sql.Timestamp getUpdateDate()
   {
      return this.updateDate;
   }

   public void setUserStatus(java.lang.Integer value)
   {
      this.userStatus = value;
   }

   public java.lang.Integer getUserStatus()
   {
      return this.userStatus;
   }

   public void setUserNote(java.lang.String value)
   {
      this.userNote = value;
   }

   public java.lang.String getUserNote()
   {
      return this.userNote;
   }

   public java.util.ArrayList getIdList()
   {
      return idList;
   }

   public void setIdList(java.util.ArrayList idList)
   {
      this.idList = idList;
   }

   /** 手动增加属性后,toString,hashCode,equals都要修改 */
   public String toString()
   {
      return new ToStringBuilder(this).append("UserId", getUserId()).append("UserAccount", getUserAccount()).append("UserName", getUserName()).append("UserPasswd", getUserPasswd()).append("RegistDate", getRegistDate())
               .append("UpdateDate", getUpdateDate()).append("UserStatus", getUserStatus()).append("UserNote", getUserNote()).toString();
   }

   public int hashCode()
   {
      return new HashCodeBuilder().append(getUserId()).append(getUserAccount()).append(getUserName()).append(getUserPasswd()).append(getRegistDate()).append(getUpdateDate()).append(getUserStatus()).append(getUserNote()).toHashCode();
   }

   public boolean equals(Object obj)
   {
      if (obj instanceof SysUser == false) return false;
      if (this == obj) return true;
      SysUser other = (SysUser) obj;
      return new EqualsBuilder().append(getUserId(), other.getUserId()).append(getUserAccount(), other.getUserAccount()).append(getUserName(), other.getUserName()).append(getUserPasswd(), other.getUserPasswd())
               .append(getRegistDate(), other.getRegistDate()).append(getUpdateDate(), other.getUpdateDate()).append(getUserStatus(), other.getUserStatus()).append(getUserNote(), other.getUserNote()).isEquals();
   }
}
